package dataBase;

public class ForeignKeyCheck {

	// Some of these are not private because I'm using them in other classes as
	// well.
	static final int INITIALIZATION = 0;
	static final int WARRIOR_RACE_ID = 30;
	static final int ELF_RACE_ID = 20;
	static final int HUMAN_RACE_ID = 10;
	private static String table, values;

	static int cityNumberCheck(String city) {
		int cityNumber = INITIALIZATION;
		String[] cities = FillDBTables.citiesArray();
		for (int i = INITIALIZATION; i < cities.length; i++) {
			if (cities[i].equals(city))
				cityNumber = (i + FillDBTables.CITY_CONSTANT);
		}
		return cityNumber;
	}

	static int raceNumberCheck(String race) {
		int raceNumber = INITIALIZATION;
		if (race.equals(FillDBTables.HUMAN_RACE))
			raceNumber = HUMAN_RACE_ID;
		else if (race.equals(FillDBTables.ELF_RACE))
			raceNumber = ELF_RACE_ID;
		else
			raceNumber = WARRIOR_RACE_ID;
		return raceNumber;
	}

	public static String getTable() {
		return table;
	}

	public static String getValues() {
		return values;
	}

}
